package com.naire.modul.employee.service;

import java.util.List;

import net.common.service.GeneralService;

import com.naire.modul.dept.dao.DeptDao;
import com.naire.modul.dept.dao.impl.DeptDaoImpl;
import com.naire.modul.employee.dao.EmployeeDao;
import com.naire.modul.employee.dao.impl.EmployeeDaoImpl;
import com.naire.modul.employee.vo.EmployeeVo;

/**
 * 
 * 
 * @author Administrator
 * 
 */
public class EmployeeSelectService extends GeneralService {

	private String dept_num;
	private Integer dept_id;
	@SuppressWarnings("rawtypes")
	private List list;

	@SuppressWarnings("unchecked")
	@Override
	public void execute() throws Exception {
		List<EmployeeVo> e_list = null;
		if(dept_id != null) {
			EmployeeDao dao = new EmployeeDaoImpl();
			e_list = dao.search(null, dept_id);			
		}
		DeptDao dao = new DeptDaoImpl();
		list = dao.search(null, dept_num);
		if(e_list != null && e_list.size() > 0) {			
			list.addAll(e_list);
		}
	}

	public void setDept_num(String dept_num) {
		this.dept_num = dept_num;
	}

	public void setDept_id(Integer dept_id) {
		this.dept_id = dept_id;
	}

	@SuppressWarnings("rawtypes")
	public List getList() {
		return list;
	}

}
